/*
  S.M.A.C.K - An operating system kernel
  Copyright (C) 2010,2011 Mattias Holm and Kristian Rietveld
  For licensing and a full list of authors of the kernel, see the files
  COPYING and AUTHORS.
*/

#ifndef STDLIB_H
#define STDLIB_H

#include <stddef.h>
#include <stdint.h>

void abort(void);
long strtol(const char *restrict str, char **restrict end, int base);
void* malloc(size_t size);
void* calloc(size_t count, size_t size);
void free(void *obj);

static inline void*
strtoptr(const char *restrict str, char **restrict end, int base)
{
  uintptr_t ptr = strtol(str, end, base);
  return (void*)ptr;
}

#endif /* !STDLIB_H */
